/**
 * @file constants.h
 * @brief all the constants are set here
 * @author achdu0000@163.com
 * @version 1.0.0
 * @date 2024/07/09
 */

#ifndef CONSTANTS_H
#define CONSTANTS_H

/**
 * set <how many>[ms] means per minute, uesd in simulation
 */
#define UNIT_TIME_MS 60000

/**
 * the only canvas width to set
 */
#define CANVAS_WIDTH 180

/**
 * the only canvas height to set
 */
#define CANVAS_HEIGHT 198

/**
 * enum of yin yang
 * - YIN  = 0
 * - YANG = 1
 */
enum YINYANG
{
    YIN = 0,
    YANG
};

/**
 * text of yin yang:
 *   阴, 阳
 */
static const char *yinyang_text_table[] = {"阴", "阳"};

/**
 * enum of wu xing
 * -  WX_JIN = 0
 * - WX_SHUI = 1
 * -   WX_MU = 2
 * -  WX_HUO = 3
 * -   WX_TU = 4
 *
 */
enum WUXING
{
    WX_JIN = 0,
    WX_SHUI,
    WX_MU,
    WX_HUO,
    WX_TU,
    WX_NOT_CLEAR
};

/**
 * text of wu xing:
 *   金、水、木、火、土
 */
static const char *wuxing_text_table[] = {"金", "水", "木", "火", "土", " "};

/**
 * enum of ten tian gan
 * - TG_JIA  = 0
 * - TG_YI   = 1
 * - TG_BING = 2
 * - TG_DING = 3
 * - TG_WU   = 4
 * - TG_JI   = 5
 * - TG_HAI  = 6
 * - TG_XIN  = 7
 * - TG_REN  = 8
 * - TG_GUI  = 9
 */
enum TIANGAN
{
    TG_JIA = 0,
    TG_YI,
    TG_BING,
    TG_DING,
    TG_WU,
    TG_JI,
    TG_HAI,
    TG_XIN,
    TG_REN,
    TG_GUI
};

/**
 * text of ten tian gan
 *   甲、乙、丙、丁、戊、己、亥、辛、壬、癸
 */
static const char *tiangan_text_table[] = {"甲", "乙", "丙", "丁", "戊", "己", "亥", "辛", "壬", "癸"};

/**
 * enum of twelve di zhi
 * - DZ_ZI   = 0
 * - DZ_CHOU = 1
 * - DZ_TG_YIN  = 2
 * - DZ_MAO  = 3
 * - DZ_CHEN = 4
 * - DZ_SI   = 5
 * - DZ_WU   = 6
 * - DZ_WEI  = 7
 * - DZ_SHEN = 8
 * - DZ_YOU  = 9
 * - DZ_XU   = 10
 * - DZ_HAI  = 11
 */
enum DIZHI
{
    DZ_ZI = 0,
    DZ_CHOU,
    DZ_TG_YIN,
    DZ_MAO,
    DZ_CHEN,
    DZ_SI,
    DZ_WU,
    DZ_WEI,
    DZ_SHEN,
    DZ_YOU,
    DZ_XU,
    DZ_HAI
};

/**
 * text of twelve di zhi
 *   子、丑、寅、卯、辰、巳、午、未、申、酉、戌、亥
 */
static const char *dizhi_text_table[] = {"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"};

/**
 * enum of four seasons
 * - SPRING = 0
 * - SUMMER = 1
 * - AUTUMN = 2
 * - WINTER = 3
 */
enum SEASON
{
    SPRING = 0,
    SUMMER,
    AUTUMN,
    WINTER
};

/**
 * text of four seasons:
 *   春、夏、秋、冬
 */
static const char *season_text_table[] = {"春", "夏", "秋", "冬"};

/**
 * enum of twenty four jie qi
 * - JQ_LI_CHUN         = 0
 * - JQ_YU_WX_SHUI      = 1
 * - JQ_WX_JING_ZHE     = 2
 * - JQ_CHUN_FEN        = 3
 * - JQ_QING_MING       = 4
 * - JQ_GU_YU           = 5
 * - JQ_LI_XIA          = 6
 * - JQ_XIAO_MAN        = 7
 * - JQ_MANG_ZHONG      = 8
 * - JQ_XIA_ZHI         = 9
 * - JQ_XIAO_SHU        = 10
 * - JQ_DA_SHU          = 11
 * - JQ_LI_QIU          = 12
 * - JQ_CHU_SHU         = 13
 * - JQ_BAI_LU          = 14
 * - JQ_QIU_FEN         = 15
 * - JQ_HAN_LU          = 16
 * - JQ_SHUANG_TG_JIANG = 17
 * - JQ_LI_DONG         = 18
 * - JQ_XIAO_XUE        = 19
 * - JQ_DA_XUE          = 20
 * - JQ_DONG_ZHI        = 21
 * - JQ_XIAO_HAN        = 22
 * - JQ_DA_HAN          = 23
 */
enum JIEQI
{
    JQ_LI_CHUN = 0,
    JQ_YU_WX_SHUI,
    JQ_WX_JING_ZHE,
    JQ_CHUN_FEN,
    JQ_QING_MING,
    JQ_GU_YU,
    JQ_LI_XIA,
    JQ_XIAO_MAN,
    JQ_MANG_ZHONG,
    JQ_XIA_ZHI,
    JQ_XIAO_SHU,
    JQ_DA_SHU,
    JQ_LI_QIU,
    JQ_CHU_SHU,
    JQ_BAI_LU,
    JQ_QIU_FEN,
    JQ_HAN_LU,
    JQ_SHUANG_TG_JIANG,
    JQ_LI_DONG,
    JQ_XIAO_XUE,
    JQ_DA_XUE,
    JQ_DONG_ZHI,
    JQ_XIAO_HAN,
    JQ_DA_HAN
};

/**
 *  text of sixty jiazi:
 *      "甲子", "乙丑", "丙寅", "丁卯", ...
 */
static const char *sixty_jiazi_text_table[] = {
    "甲子", "乙丑", "丙寅", "丁卯", "戊辰", "己巳", "庚午", "辛未", "壬申", "癸酉",
    "甲戌", "乙亥", "丙子", "丁丑", "戊寅", "己卯", "庚辰", "辛巳", "壬午", "癸未",
    "甲申", "乙酉", "丙戌", "丁亥", "戊子", "己丑", "庚寅", "辛卯", "壬辰", "癸巳",
    "甲午", "乙未", "丙申", "丁酉", "戊戌", "己亥", "庚子", "辛丑", "壬寅", "癸卯",
    "甲辰", "乙巳", "丙午", "丁未", "戊申", "己酉", "庚戌", "辛亥", "壬子", "癸丑",
    "甲寅", "乙卯", "丙辰", "丁巳", "戊午", "己未", "庚申", "辛酉", "壬戌", "癸亥"};

/**
 * text of twenty four jieqi:
 *    立春、雨水、惊蛰、春分、清明、谷雨、立夏、小满、芒种、夏至、小暑、大暑、立秋、处暑、白露、秋分、寒露、霜降、立冬、小雪、大雪、冬至、小寒、大寒
 */
static const char *twenty_four_jieqi_text_table[] = {
    "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满",
    "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", 
    "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒"};

/**
 * the wuxing table of twenty four jieqi for looking up, like:
 * - [ 0] (lichun) -> WX_MU
 * - ...
 * - [23] (dahan) -> WX_SHUI
 */
static WUXING twenty_four_jieqi_wuxing_table[] = {
    WX_MU, WX_MU, WX_MU, WX_MU, WX_MU, WX_MU,
    WX_HUO, WX_HUO, WX_HUO, WX_HUO, WX_HUO,
    WX_TU, WX_TU,
    WX_JIN, WX_JIN, WX_JIN, WX_JIN, WX_JIN, WX_JIN,
    WX_SHUI, WX_SHUI, WX_SHUI, WX_SHUI, WX_SHUI};

/**
 * the wuxing table of sixty jiazi for looking up, like:
 * - [ 0] (jiazi) -> WX_JIN
 * - ...
 * - [59] (guihai) -> WX_SHUI
 */

static WUXING sixty_jiazi_wuxing_table[] = {
    WX_JIN, WX_JIN, WX_HUO, WX_HUO, WX_MU, WX_MU,
    WX_TU, WX_TU, WX_JIN, WX_JIN, WX_HUO, WX_HUO,
    WX_SHUI, WX_SHUI, WX_TU, WX_TU, WX_JIN, WX_JIN,
    WX_MU, WX_MU, WX_SHUI, WX_SHUI, WX_TU, WX_TU,
    WX_HUO, WX_HUO, WX_MU, WX_MU, WX_SHUI, WX_SHUI,
    WX_JIN, WX_JIN, WX_HUO, WX_HUO, WX_MU, WX_MU,
    WX_TU, WX_TU, WX_JIN, WX_JIN, WX_HUO, WX_HUO,
    WX_SHUI, WX_SHUI, WX_TU, WX_TU, WX_JIN, WX_JIN,
    WX_MU, WX_MU, WX_SHUI, WX_SHUI, WX_TU, WX_TU,
    WX_HUO, WX_HUO, WX_MU, WX_MU, WX_SHUI, WX_SHUI};

/**
 * twelve meridian text table
 *    "胆经", "肝经", "肺经", "大肠经", "胃经", "脾经", "心经", "小肠经", "肾经", "心包经", "三焦经"
 */
static const char *twelve_meridian_text_table[] = {"胆经", "肝经", "肺经", "大肠经", "胃经", "脾经", "心经", "小肠经", "膀胱经", "肾经", "心包经", "三焦经"};

/**
 * the wuxing table of twelve meridian for looking up, like:
 * - [ 0] (danjing) -> WX_MU
 * - ...
 * - [11] (sanjiaojin) -> WX_NOT_CLEAR
 */
static WUXING twelve_meridian_wuxing_table[] = {
    WX_MU, WX_MU, WX_JIN, WX_JIN,
    WX_TU, WX_TU, WX_HUO, WX_HUO,
    WX_SHUI, WX_SHUI, WX_NOT_CLEAR, WX_NOT_CLEAR};

struct sensor_data {
    uint16_t body_temperature_val;
    uint16_t body_blood_press_h_val;
    uint16_t body_blood_press_l_val;
    uint8_t body_blood_oxygen_val;
    uint8_t body_heart_rate_val;
    uint16_t body_walk_step_val;
};

#endif // CONSTANTS_H